import Vue from 'vue'
import tips from './tips.vue'
let tipsConstructor = Vue.extend(tips);
let tipsFunc = function (content) {
    return new Promise((res, rej) => {
        let tipsExample = new tipsConstructor({
            el: document.createElement('div')
            //data:content 不能直接覆盖 data 会报 bug 原data 有 对于 vue的引用 ，覆盖后就没有了
        });
        //console.log(prompBoxExample);
        //return;
        tipsExample.content = content;
        document.body.appendChild(tipsExample.$el);
        setTimeout(() => {
            document.querySelector('.tips-container').remove();
        }, 3000);
    });
}
tipsFunc.show = options => {
    return tipsFunc(options);
}

export default tipsFunc;